package com.caocaog.market.front;

import com.caocaog.market.annotation.IgnoreAuth;
import com.caocaog.market.entity.Protocol;
import com.caocaog.market.service.ProtocolService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.GenericController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api(value = "protocol", tags = "协议管理移动端API")
@RequestMapping("/api/protocol")
public class ProtocolFrontController extends GenericController<Protocol, ProtocolService> {

    @IgnoreAuth
    @ApiOperation(value = "根据类型获取协议", notes = "根据协议类型获取协议信息")
    @GetMapping("getByType")
    public Result<?> getProtocol(@RequestParam("type") Integer type) {
        return Result.OK(super.service.getProtocolById(type));
    }

}
